<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<link rel="stylesheet" type="text/css" href="scripts/plugins/wookmark/css/reset.css"/>
<link rel="stylesheet" type="text/css" href="css/style.css"/>
<link rel="stylesheet" type="text/css" href="scripts/plugins/lightbox/lightbox.css"/>
<title>Sample Implementation</title>

<script type="text/javascript" src="scripts/jquery/jquery-1.9.1.js" ></script>
<script type="text/javascript" src="scripts/plugins/wookmark/jquery.wookmark.js"></script>
<script type="text/javascript" src="scripts/plugins/lightbox/lightbox.js"></script>
</head>
<body>
	<div style="width:800px;height: 100%;" >
    	<ul id="photogallery">
			<?php
            
            if ($handle = opendir('photos/album1')) {
            
                /* This is the correct way to loop over the directory. */
                while (false !== ($entry = readdir($handle))) {
					if ($entry != "." && $entry != "..") {
						$imagesize = getimagesize("photos/album1/$entry");
						//$dim = round($imagesize[1] / $imagesize[0]*300);
						//echo $dim;
						//echo "<a href=\"photos/album1/$entry\"><li><img src=\"photos/album1/$entry\" width=\"300\" height=\"round($imagesize[1]/$imagesize[0]*300)\" /></li></a>";
						echo "<a href=\"photos/album1/$entry\"><li><img src=\"photos/album1/$entry\" width=\"200\" height=\"round($imagesize[1]/$imagesize[0]*200)\" /></li></a>";
					}
					
					//list($width, $height, $type, $attr) = getimagesize("photos/album1/"+ $entry);
					//echo $width;
                    //echo "<li><img src='photos/album1/"+ $entry +"' width='300' height="+ $round($height/$width*300) +"/></li>";
                }
           
                closedir($handle);
            }
            ?>
        </ul>
    </div>
</body>

<script type="text/javascript" src="scripts/photogallery.js" ></script>

</html>
